/**
 * Copyright ©2016-2020 northkingbpo Corporation, All Rights Reserved
 * http://www.northkingbpo.net/
 */
package com.north.king.profile.http.client.resttemplate.domain;

import com.north.king.profile.http.client.resttemplate.common.ConstantVariable;
import lombok.Data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

/**
 * class info
 *
 * @author hujia
 * @date 2019-01-09 09:05
 */
@Data
public class User {
    private String userId;
    private int taskNum;
    private long forecastTime;
    private List<String> wantDo;
    // busiType-workqueue 90
    // begin with 1
    private Map<String, Integer> delegateList;

    public User() {
        delegateList = new HashMap<>();
    }

    public void init(int busiTypeTotal, int workqueueTotal, int busiTypeBase, int workqueueBase) {
        Random random = new Random();
        for (int i = 1; i <= busiTypeTotal; ++i) {
            for (int j = 1; j <= workqueueTotal; ++j) {
                delegateList.put(ConstantVariable.CONDITION_ONE + (i + busiTypeBase - 1) + ConstantVariable.SEPARATOR
                                + ConstantVariable.CONDITION_TWO + (j + workqueueBase - 1),
                        random.nextInt(ConstantVariable.NORMAL_RANGE) + ConstantVariable.NORMAL_BASE);
            }
        }
    }
}
